/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package copecscheduling;

import java.io.*;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Locale;


/**
 *
 * @author Rodrigo
 */
public class IOPrevSchedule {
    private int num_days;

    public IOPrevSchedule(){

    }

    public ArrayList<Integer> ReadHistory(Calendar date){
        File history_file = new File(fileName(date));
        ArrayList<Integer> history = new ArrayList<Integer>();



        return history;
    }

    
    public void setNum_days(int num_days) {
        this.num_days = num_days;
    }

    public int getNum_days() {
        return num_days;
    }

    private String fileName(Calendar date){
        int year;
        Calendar date_tmp = (Calendar) date.clone();
        String month = "";
        String file = "";

        year = date_tmp.get(Calendar.YEAR);

        if(date_tmp.get(Calendar.MONTH) == 0){
            month = "Diciembre";
            date_tmp.roll(Calendar.YEAR, false);
            year = date_tmp.get(Calendar.YEAR);
        }
        else{
            switch(year){
                case 1: month = "Enero";
                        break;
                case 2: month = "Febrero";
                        break;
                case 3: month = "Marzo";
                        break;
                case 4: month = "Abril";
                        break;
                case 5: month = "Mayo";
                        break;
                case 6: month = "Junio";
                        break;
                case 7: month = "Julio";
                        break;
                case 8: month = "Agosto";
                        break;
                case 9: month = "Septiembre";
                        break;
                case 10: month = "Octubre";
                        break;
                case 11: month = "Noviembre";
                        break;
            }
        }

        file = "/Historial/"+month+"-"+year+".SCH";

        return file;
    }
}



